var realtop = angular.module('realtopApp', ['ngRoute']);
realtop.config(function ($routeProvider) {
    $routeProvider
        .when('/', {
            templateUrl: 'pages/home.html',
            controller: 'homeController'
        })
        .when('/news', {
            templateUrl: 'pages/news.html',
            controller: 'newsController'
        })
        .when('/contactUs', {
            templateUrl: 'pages/contactUs.html',
            controller: 'contactController'
        })
        .when('/joinUs', {
            templateUrl: 'pages/joinUs.html',
            controller: 'joinController'
        })
        .when('/company', {
            templateUrl: 'pages/company.html',
            controller: 'companyController'
        })
        .when('/idea', {
            templateUrl: 'pages/idea.html',
            controller: 'ideaController'
        })
        .when('/culture', {
            templateUrl: 'pages/culture.html',
            controller: 'cultureController'
        })
        .when('/partModule', {
            templateUrl: 'pages/partModule.html',
            controller: 'partModuleController'
        })
        .when('/newDetail', {
            templateUrl: 'pages/newDetail.html',
            controller: 'newDetailModuleController'
        })
        .when('/jobInfo', {
            templateUrl: 'pages/jobInfo.html',
            controller: 'jobInfoController'
        });
});
realtop.controller('mainController', function ($scope) {
    $scope.backTop = function () {
        $('html,body').animate({
            scrollTop: '0px'
        }, 800);
    };
});
realtop.controller('homeController', function ($scope) {

});
realtop.controller('newsController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('contactController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('joinController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('companyController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('ideaController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('cultureController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('partModuleController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);

});
realtop.controller('newDetailModuleController', function ($scope,$timeout) {
    $timeout(function () {
        var height = document.getElementsByClassName("topImage")[0].offsetHeight;
        $("html,body").animate({scrollTop: height}, 2000);
    }, 1000);
});
realtop.controller('jobInfoController', function ($scope,$timeout) {
    $timeout(function () {
        $("html,body").animate({scrollTop: "0px"}, 2000);
    }, 1000);

});